package com.tarena.charging.device.repository;

import cn.tedu.charging.common.pojo.param.GunStatusUpdateParam;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tarena.charging.device.mapper.GunMapper;
import com.tarena.charging.device.po.GunPO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class GunRepository {
    @Autowired
    private GunMapper gunMapper;

    public Integer getPiledByGunId(Integer id) {
        GunPO po = gunMapper.selectById(id);
        return po.getPileId();
    }

    public int updateGunStatus(GunStatusUpdateParam param) {
        GunPO poParam= new GunPO();
        poParam.setId(param.getGunId());
        poParam.setGunStatus(param.getStatus());
        return gunMapper.updateById(poParam);
    }
}
